﻿#region Disclaimer/Info

/////////////////////////////////////////////////////////////////////////////////////////////////
//
//   File:		ConfigurationBinder.cs
//   Website:		http://dexterblogengine.com/
//   Authors:		http://dexterblogengine.com/About.ashx
//   Rev:		1
//   Created:		19/01/2011
//   Last edit:		19/01/2011
//   License:		GNU Library General Public License (LGPL)
//   File:            ConfigurationBinder.cs
//   For updated news and information please visit http://dexterblogengine.com/
//   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
//   For any question contact info@dexterblogengine.com
//
///////////////////////////////////////////////////////////////////////////////////////////////////

#endregion

using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Dexter.Core.Helpers;
using Dexter.Web.Mvc.ViewModel.Resources;

namespace Dexter.Web.Mvc.ViewModel.Backoffice.Binders {
	public class ConfigurationBinder {
		public ConfigurationBinder ( ) {
			ReCaptcha = new ReCaptchaBinder ( );
			Smtp = new SmtpBinder ( );
			GoogleAnalyticsConfigs = new GoogleAnalyticsConfigsBinder ( );
			AdvancedFeatues = new AdvancedFeatuesBinder ( );
		}

		[Required(ErrorMessageResourceType = typeof(Errors), ErrorMessageResourceName = "RequiredField")]
		public string ThemeName { get; set; }
		public bool NotifyNewComment { get; set; }
		public bool NotifyNewTrackback { get; set; }
		public bool EnableTrackBackSend { get; set; }
		public bool EnableTrackBackReceive { get; set; }
		public bool EnablePingBackSend { get; set; }
		public bool EnablePingBackReceive { get; set; }
		public bool EnableReferrerTracking { get; set; }
		public string TimeZone { get; set; }
		public string CultureInfo { get; set; }
		public int ModerationType { get; set; }
		public int? DayBeforeDisableComment { get; set; }
		public ReCaptchaBinder ReCaptcha { get; set; }
		public SmtpBinder Smtp { get; set; }
		public GoogleAnalyticsConfigsBinder GoogleAnalyticsConfigs { get; set; }
		public AdvancedFeatuesBinder AdvancedFeatues { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 100 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string DefaultTitle { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 500 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string DefaultDescription { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 400 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string DefaultKeyWords { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 100 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string CopyRight { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		public string Language { get; set; }

		[Required ( ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "RequiredField" )]
		[StringLength ( 100 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string BlogName { get; set; }

		[StringLength ( 250 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[RegularExpression ( KnownRegex.MailAddress , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "InvalidFormat" )]
		[AllowHtml]
		public string SenderEmail { get; set; }

		public string SenderEmailDisplayName { get; set; }

		[StringLength ( 1000 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[RegularExpression ( KnownRegex.Url , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "InvalidFormat" )]
		public string FeedBurnerUrl { get; set; }

		[StringLength ( 16 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		public string AkismetApiKey { get; set; }

		[StringLength ( 4000 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[AllowHtml]
		public string FooterCode { get; set; }

		[StringLength ( 4000, ErrorMessageResourceType = typeof ( Errors ), ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[AllowHtml]
		public string HeaderCode { get; set; }

		[StringLength ( 250 , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "MaximumLengthExceeded" )]
		[RegularExpression ( KnownRegex.MailAddress , ErrorMessageResourceType = typeof ( Errors ) , ErrorMessageResourceName = "InvalidFormat" )]
		public string NotificationEmailAddress { get; set; }
	}
}